import java.util.ArrayList;
import java.util.Iterator;


public abstract class AbstractSubject
{

	private ArrayList<Observer> observers = new ArrayList<Observer>();
	
	public AbstractSubject()
	{
		
	}
	public void addObserver(Observer ob)
	{
		observers.add(ob);
	}
	public void deleteObserver(Observer ob)
	{
		observers.remove(ob);
	}
	public void notifyObservers(Object args)
	{
		Iterator i = observers.iterator();
		while(i.hasNext())
		{
			Observer o = (Observer)i.next();
			o.update(this, args);
		}
	}
}
